﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Utils.Wpf;

namespace StockAnalyst2.Chart
{
	internal class ChartDataVM : ViewModelBase
	{
		#region Attributes

		private readonly ChartData _model;

		#endregion

		#region Properties

		public BarSeriesVM LastValueBar { get; private set; }
		public SeriesVM LastValue { get; private set; }
		public SeriesVM LastValuePercentage { get; private set; }
		public SeriesVM BidAskAverage { get; private set; }
		public BandSeriesVM BidAsk { get; private set; }
		public SeriesVM SMA1 { get; private set; }
		public SeriesVM SMA2 { get; private set; }
		public SeriesVM SMA3 { get; private set; }
		public SeriesVM Stochastic { get; private set; }
		public SeriesVM Gap { get; private set; }
		public SeriesVM Trix { get; private set; }
		public SeriesVM TrixRatioOfChange { get; private set; }
		public SeriesVM Volume { get; private set; }
		public SeriesVM TotalVolume { get; private set; }
		public SeriesVM AverageVolume { get; private set; }

		public ChartOptionsVM ChartOptionsVM { get; private set; }

		#endregion

		#region Public Methods

		public ChartDataVM(ChartData model)
		{
			_model = model;

			this.ChartOptionsVM = new ChartOptionsVM(_model.Options);

			this.LastValueBar = new BarSeriesVM(_model.LastValueBar, "Last Value Bar");
			this.LastValue = new SeriesVM(_model.LastValue, "Last Value");
			this.LastValuePercentage = new SeriesVM(_model.LastValuePercentage, "");
			this.BidAskAverage = new SeriesVM(_model.BidAskAverage, "Bid Ask Average");
			this.BidAsk = new BandSeriesVM(_model.BidAsk, "Bid - Ask");
			this.SMA1 = new SeriesVM(_model.SMA1, "SMA1");
			this.SMA2 = new SeriesVM(_model.SMA2, "SMA2");
			this.SMA3 = new SeriesVM(_model.SMA3, "SMA3");
			this.Stochastic = new SeriesVM(_model.Stochastic, "Stochastic");
			this.Gap = new SeriesVM(_model.Gap, "Gap %");
			this.Trix = new SeriesVM(_model.Trix, "TRIX");
			this.TrixRatioOfChange = new SeriesVM(_model.TrixRatioOfChange, "TRIX Change Ratio");
			this.Volume = new SeriesVM(_model.Volume, "Volume");
			this.TotalVolume = new SeriesVM(_model.TotalVolume, "Total Volume");
			this.AverageVolume = new SeriesVM(_model.AverageVolume, "Average Volume");
		}

		#endregion
	}
}
